package com.bazhua.bazo.repository.model.result;

import java.io.Serializable;

public class CommonResult<T> implements Serializable {

    private static final long serialVersionUID = 7070149896025566800L;

    /**
     * 返回code
     */
    private Integer code;

    /**
     * 结果描述
     **/
    private String message;

    /**
     * 返回结果
     */
    private T data;


    public CommonResult() {
        this.code = BaseResultCode.SUCCESS.getCode();
        this.message = BaseResultCode.SUCCESS.getMsg();
    }

    public CommonResult(IResultCode resultCode) {
        this.code = resultCode.getCode();
        this.message = resultCode.getMsg();
    }


    public CommonResult(int bizCode, String bizMsg) {
        this.code = bizCode;
        this.message = bizMsg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

}
